package com.wanmait.happyheating.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.wanmait.happyheating.pojo.Userinfo;
import com.wanmait.happyheating.service.UserinfoService;
import com.wanmait.happyheating.util.Result;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController//指定他是一个控制器的controller注解，每个方法默认加上注解@ResponseBody
@RequestMapping("/manage")//公用的路径


public class UserSafePhoneController
{

        @Resource//
        private UserinfoService userinfoService;//链接什么数据库就写什么Service
        @PostMapping("updateUserinfo")//请求方式
        public Result findsafePhone(Integer id, @RequestBody Userinfo userinfo)//@RequsetBody注解 接收对象
        {
            userinfoService.updateById(userinfo);
            return Result.success(userinfo);
        }


    }
